<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="evalFunc('01')">1</button>
<button onclick="evalFunc('02')">2</button>
</body>
<script type="text/javascript">

    function test01() {
        console.log('test01');
    }

    function test02() {
        console.log('test02');
    }

    function evalFunc(value) {
        let func = eval("test" + value);
        func();
    }

</script>
</html>